<template>
  <div>
    <p> {{ sex=== 1 ? '男' : '女' }} </p>
    <button @click="btn">点击切换</button>
  </div>
</template>

<script>
export default {
  data () {
    return {
      sex: 0
    }
  },

  created () {

  },

  methods: {
    btn() {
      if(this.sex===1){
        this.sex=0
      }else{
        this.sex=1
      }
    }
  }
}
</script>

<style scoped lang='less'>

</style>
